package com.shujia.mrjq

import java.io.InputStream
import scala.io.Source

object ZqzfUtil {
  def getKJ: Map[String, List[String]] = {
    val inputStream: InputStream = ZqzfUtil
      .getClass
      .getClassLoader
      .getResourceAsStream("zqzf_indexs.txt")

    Source
      .fromInputStream(inputStream)
      .getLines()
      .map(line => {
        val splits: Array[String] = line.split("-")
        val index: String = splits(0)
        val code: String = splits(1)
        val codeList: List[String] = code.split(",").toList
        (index, codeList)
      })
      .toMap
  }

  def main(args: Array[String]): Unit = {
    getKJ.foreach(println)
    println(getKJ("wdtk"))
  }

}
